/**
 * Created by Administrator on 2016/6/26.
 */
"use strict";
swan_pc
    .controller("TaskController",function($scope,$rootScope,$state){
        //console.log("Task");
        $scope.inputTaskName=null;
        $scope.taskViewActive=1;
        $scope.changeViewShow=function(option){
            //console.log("nowState:"+$rootScope.toState.name);
            /*if($rootScope.toState.name=="taskcalshow"){
                //console.log("to tasklist is run");
                $state.go("tasklist");
            }else{
                $state.go("taskcalshow");
            }*/
            if($scope.taskViewActive==1&&option==2){
                $scope.taskViewActive=2;
                $state.go("tasklist");
            }
            if($scope.taskViewActive==2&&option==1){
                $scope.taskViewActive=1;
                $state.go("taskcalshow");
            }
            /*if($rootScope.toState.name=="tasklist"){
                $state.go("taskcalshow");
            }*/
        }
    });
